What’s the difference between System.Text.StringBuilder and System.String?
5077
15-Oct-2010
Amit Singh
16-Apr-2011Difference between StringBuilder and string
String and StringBuilder class stores strings. But when you cannot change a String object after creating one.
eg: String name = "amit";
By saying you cannot change the name object means you cannot change the value in name object internally. When you
change the name object value to something else, a new String object is creating in memory and assign the new value.
Example: name = "Amit Singh";
If you are doing string concatenation StringBuilder class is far better in performance than String class.
You can use StringBuilder's Append() method to use concatenation.
Uttam Misra
29-Oct-2010